package com.fr.chart.axis;

import com.fr.base.core.json.JSONException;
import com.fr.base.core.json.JSONObject;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;
import com.fr.chart.DataSeriesCondition;

public class SeriesAttrPosition
  implements DataSeriesCondition
{
  private static final long serialVersionUID = -9143721712833342000L;
  public static final String XML_TAG = "SeriesAttrPosition";
  private int position = 1;

  public void setPosition(int paramInt)
  {
    this.position = paramInt;
  }

  public int getPosition()
  {
    return this.position;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str1 = paramXMLableReader.getTagName();
      if (str1.equals("Attr"))
      {
        String str2;
        if ((str2 = paramXMLableReader.getAttr("position")) != null)
          setPosition(Byte.parseByte(str2));
      }
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("SeriesAttrPosition");
    paramXMLPrintWriter.startTAG("Attr").attr("position", getPosition());
    paramXMLPrintWriter.end();
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }

  public boolean equals(Object paramObject)
  {
    if (!(paramObject instanceof SeriesAttrPosition))
      return false;
    SeriesAttrPosition localSeriesAttrPosition = (SeriesAttrPosition)paramObject;
    return (localSeriesAttrPosition.position == this.position);
  }

  public JSONObject toJSONObject()
    throws JSONException
  {
    JSONObject localJSONObject = new JSONObject();
    localJSONObject.put("position", this.position);
    return localJSONObject;
  }

  public String getConditionType()
  {
    return "SeriesAttrPosition";
  }
}